<template>
	<view class="my-cell-group" @tap="clickHandler">
		<view class="my-cell">
			<uni-icons v-if="iconType==='hollow'" custom-prefix="iconfont" :type="icon" :color="iconColor" size="30"/>
			<view class="left-icon" v-else>
				<uni-icons custom-prefix="iconfont" :type="icon" :color="iconColor" size="32"/>
			</view>
			<view class="label">
				<text class="fsize-30">{{title}}</text>
				<text class="line-gray fsize-24">{{label}}</text>
			</view>
			<slot name="right-value" v-if="$slots['right-value']"></slot>
			<uni-icons v-else type="right" color="#909399" size="20"/>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			title: {
				type: String,
				default: ''
			},
			label: {
				type: String,
				default: ''
			},
			iconType:{
				type: String,
				default: 'circular'
			},
			icon: {
				type: String,
				default: 'color'
			},
			iconColor: {
				type: String,
				default: '#fff'
			},
			rIcon: {
				type: String,
				default: ''
			},
			disabled:{
				type: Boolean,
				default: false
			},
			url:{
				type: String,
				default: ''
			}
		},
		data () {
			return {}
		},
		methods: {
			// 点击cell
			clickHandler() {
				let that = this
				if (this.disabled) return
				uni.$u.route(that.url)
			},
		}
	}
</script>

<style lang="scss">
	.my-cell-group{
		background-color: #fff;
		.my-cell{
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 10px;
			margin-bottom: 5px;
			.left-icon{
				padding: 5px;
				border-radius: 50%;
				background: linear-gradient(to bottom right,#d90e3b,#dd585d);
				flex-shrink: 0;
			}
			.label{
				width: 100%;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				margin-left: 20rpx;
			}
		}
	}
</style>